﻿@model IEnumerable<WuKeSong.Areas.Music.Models.Music>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            Author
        </th>
        <th>
            Genre
        </th>
        <th>
            Sheet Music
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Author)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Genre)
        </td>
        <td>
        @if (string.IsNullOrEmpty(item.SheetMusic)==false)
        {
            <a href="@item.SheetMusic">link</a>
        }
        else
        {
            <span></span>             
        }
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}
</table>
<br/>
<div>
    @Html.ActionLink("Show Genre List", "Index","Genre") | 
    @Html.ActionLink("Back to Main Area", "Index", new { area = "Main" })
</div>
